package com.cmxh.shipper.controller;

import com.cmxh.shipper.pojo.Team;
import com.cmxh.shipper.service.TeamService;
import com.cmxh.shipper.util.Code;
import com.cmxh.shipper.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/team")
public class TeamController {
    @Autowired
    private TeamService teamService;

    @RequestMapping("/selectAll")
    public Result selectAll() {
        List<Team> teams = teamService.selectAll();
        if (teams != null) {
            return new Result(Code.GET_OK,teams, "查询成功");
        } else {
            return new Result(Code.GET_ERR, "查询失败");
        }
    }
}
